<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="google" value="notranslate">
  <link rel="shortcut icon" href="static/favicon.ico">
  <title><%= htmlWebpackPlugin.options.title %></title>
  <% if (htmlWebpackPlugin.options.sentryConfig) { %>
  <!-- Sentry error logging to help with finding bugs -->
  <script src="https://cdn.ravenjs.com/3.22.1/raven.min.js" crossorigin="anonymous"></script>
  <script>
    Raven.config(<%= htmlWebpackPlugin.options.sentryConfig %>).install();
  </script>
  <!-- /Sentry -->
  <% } %>
  <script>
    window.scratchConfig = {
      logo: {
        show: true
        // , url: ""
        , url: "https://scratch.mit.edu/images/logo_sm.png"
        , handleClickLogo: () => {
          console.log('点击LOGO')
        }
      }, menuBar: {
        color: 'hsla(215, 100%, 65%, 1)'
      }, shareButton: {
        show: true,
        handleClickShare: () => {
          console.log('分享按钮')
          window.scratch.getProjectCover(cover => {
            //TODO 获取到作品截图
            console.log(cover)
          })
          window.scratch.getProjectFile(file => {
            //TODO 获取到项目文件
            console.log(file)
          })
          var projectName = window.scratch.getProjectName()
          console.log(projectName);
        }
      }, handleVmInitialized: (vm) => {
        window.vm = vm
        console.log("VM初始化完毕")
        
      },handleProjectLoaded:() => {
        console.log("作品完毕")

      },handleDefaultProjectLoaded:() => {
        //默认作品加载完毕
        window.scratch.setProjectName("默认项目")
        //  window.scratch.loadProject("/project.sb3", () => { 
        //     console.log("项目加载完毕")
        //     window.scratch.setProjectName("默认项目")
        //  })
      },
      //若使用官方素材库请删除本配置项
      // assetCDN: 'http://scratch.qiniu.xxx.com' 
    }


  </script>
</head>

<body>
  <div id="scratch">
    
  </div>
</body>
<script>

</script>

</html>